package com.axsoft.jobimp.types;

public class Bool extends DataType {

	public Bool() {
		super(1);
	}
	
	public Bool(final boolean pData) {
		super(1);
		setBool(pData);
	}
	
	public Bool(final byte[] pData) {
		super(1);
		
		mData = pData.clone();
	}
	
	public void setBool(final boolean pData) {
		if (pData) {
			mData[0] = (byte) 0xFF;
		} else {
			mData[0] = 0x00;
		}
	}
	
	public final boolean getValue() {
		if (mData[0] == (byte) 0xFF) {
			return true;
		} else {
			return false;
		}
		
	}
	
}
